package com.sl.au.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

@Entity
@Table(name = "sl_au_module")
public class Module extends Root {
	@Transient
	private String webRoot;
	//操作控制
	@Transient
	private boolean canRead;
	@Transient
	private boolean canAdd;
	@Transient
	private boolean canDelete;
	@Transient
	private boolean canModify;
	@Transient
	private boolean canOther1;

	@Transient
	private boolean canOther2;
	@Transient
	private String dataFilter;

	/** 菜单的级数 */
	@Column(name = "sMenuLevel")
	private int menuLevel;

	/** 菜单的序号 **/
	@Column(name = "sMenuIndex")
	private int menuIndex;

	/** 中文显示名称 */
	@Column(name = "sModuleName")
	private java.lang.String moduleName;
	/** 英文名 */
	@Column(name = "sName")
	private java.lang.String name;
	/** 分组名称 */
	@Column(name = "sGroupId")
	private java.lang.String groupId;
	/** 父节点id */
	@Column(name = "sParentId")
	private java.lang.String parentId;
	/** 链接路径 */
	@Column(name = "sTarget")
	private java.lang.String target;
	/** 图像 */
	@Column(name = "sIcon")
	private java.lang.String icon;
	/** 模型菜单id */
	@Column(name = "sMenuId")
	private java.lang.String menuId;
	/** 是否为父节点 */
	@Column(name = "sIsParent")
	private java.lang.String isParent;
	/** 是否展开树 */
	@Column(name = "sIsOpen")
	private java.lang.String isOpen;
    
	/**是否移動端功能*/
	@Column(name="sIsMobile")
	private java.lang.String mobile;
	
	

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public boolean isCanOther1() {
		return canOther1;
	}
	
	public void setCanOther1(boolean canOther1) {
		this.canOther1 = canOther1;
	}
	
	public boolean isCanOther2() {
		return canOther2;
	}
	
	public void setCanOther2(boolean canOther2) {
		this.canOther2 = canOther2;
	}
	public int getMenuLevel() {
		return menuLevel;
	}

	public void setMenuLevel(int menuLevel) {
		this.menuLevel = menuLevel;
	}

	public int getMenuIndex() {
		return menuIndex;
	}

	public void setMenuIndex(int menuIndex) {
		this.menuIndex = menuIndex;
	}

	public Module() {
	}

	@Autowired
	public Module(@Value("${server.context-path}") String root) {
		this.webRoot = root;
	}

	public String getModuleName() {
		return moduleName;
	}

	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getMenuId() {
		return menuId;
	}

	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}

	public String getIsParent() {
		return isParent;
	}

	public void setIsParent(String isParent) {
		this.isParent = isParent;
	}

	public String getIsOpen() {
		return isOpen;
	}

	public void setIsOpen(String isOpen) {
		this.isOpen = isOpen;
	}


	@Override
	public String toString() {
		return String.format("Module[moduleName=%1$s," + "menuLevel=%2$d,menuIndex=%3$d", this.getModuleName(),
				this.getMenuLevel(), this.getMenuIndex()+"]");
	}

	public String getWebRoot() {
		return webRoot;
	}

	public void setWebRoot(String webRoot) {
		this.webRoot = webRoot;
	}

	public boolean isCanRead() {
		return canRead;
	}

	public void setCanRead(boolean canRead) {
		this.canRead = canRead;
	}

	public boolean isCanAdd() {
		return canAdd;
	}

	public void setCanAdd(boolean canAdd) {
		this.canAdd = canAdd;
	}

	public boolean isCanDelete() {
		return canDelete;
	}

	public void setCanDelete(boolean canDelete) {
		this.canDelete = canDelete;
	}

	public boolean isCanModify() {
		return canModify;
	}

	public void setCanModify(boolean canModify) {
		this.canModify = canModify;
	}

	public String getDataFilter() {
		return dataFilter;
	}

	public void setDataFilter(String dataFilter) {
		this.dataFilter = dataFilter;
	}
	
	
}
